<template>
	<div>
<!-- 		<mt-header title="小吕的测试项目">
  		<router-link to="/" slot="left">
   		 <mt-button icon="back">back</mt-button>
 		 </router-link>
		</mt-header> -->

		<ul class="mui-table-view">
				<li v-for="item in newslist" :key="item.id" class="mui-table-view-cell mui-media">
					<router-link :to="'/home/NewsInfo/'+item.id" href="javascript:;">
						<img class="mui-media-object mui-pull-left" :src="item.img_url">
						<div class="mui-media-body">
							<h4>{{item.title}}</h4>
							<p class='mui-ellipsis'>
								<span>发表时间:{{ item.add_time | dateFormat }}</span>
								<span>点击:{{ item.click }}次</span>
							</p>
						</div>
					</router-link>
				</li>
<!-- 				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="http://i.dyt4.cc/19/02/f1/62/a7/26/6b/8c/97/ea/4f/54/7c/61/c4/a6.jpg">
						<div class="mui-media-body">
							<h4>幸福</h4>
							<p class='mui-ellipsis'>
								<span>发表时间:2018-12-12 12:00:00</span>
								<span>点击:0次</span>
							</p>
						</div>
					</a>
				</li>
				<li class="mui-table-view-cell mui-media">
					<a href="javascript:;">
						<img class="mui-media-object mui-pull-left" src="http://img4q.duitang.com/uploads/item/201507/11/20150711135438_LE5wi.jpeg">
						<div class="mui-media-body">
							<h4>幸福</h4>
							<p class='mui-ellipsis'>
								<span>发表时间:2018-12-12 12:00:00</span>
								<span>点击:0次</span>
							</p>
						</div>
					</a>
				</li> -->

			</ul>
	</div>


</template>

<script>

import { Toast } from "mint-ui"

export default {
	data() {
		return {
		newslist :[]
		}
	},
	created(){
		this.getnewsList()
	},
	methods : {
		getnewsList () {
			this.$http.get('api/getnewslist').then(result=>{
				if(result.body.status == 0){
					this.newslist = result.body.message
				}else {
					Toast("获取新闻列表失败！")
				}
			})
		}
	}
};

</script>

<style lang="scss" scoped>
.mui-table-view{
	li {
		h4 {
		font-size: 14px;
		}
		.mui-ellipsis {
			font-size : 12px;
			color : #226aff;
			display : flex;
			justify-content : space-between;
		}

	}
}


</style>
